﻿package game.objects {
	
	import game.Config;
	
	public class DesktopFBObject {
		
		public static const DISPLAY_PAGE:String		= "page";
		public static const DISPLAY_POPUP:String	= "popup";
		public static const DISPLAY_TOUCH:String	= "touch";
		public static const DISPLAY_WAP:String		= "wap";
		
		public var id:String;
		public var permissions:String;
		public var display:String;
		
		public function DesktopFBObject(id:String, permissions:String, display:String):void {
			
			this.id						= id;
			this.permissions			= permissions;
			this.display				= display;
			
		}
		
		public function get token():String			{ return Config.FB_URL_AUTH+"?client_id="+id+"&scope="+permissions+"&redirect_uri="+redirect_uri+"&display="+display+"&type=user_agent&response_type=token"; }
		
		public function get redirect_uri():String	{ return Config.FB_REDIRECT }
		
		public function toString():String { return GameObject.formatToString(this, 'id', 'permissions', 'display', 'redirect_uri', 'token'); }
		
	}
}